#include "Physics.h"
#include "Player.h"
#include "DirectXStuff.h"

#include <vector>

void cubeToCube(Player * Player1, Player * Player2)
{
        /*
        //Create tempoary variables based on the game objects (cube's)
        float left1 = GO1->getPosition().x - CV1->width / 2;                    float left2 = GO2->getPosition().x - CV2->width / 2;                    
        float right1 = GO1->getPosition().x + CV1->width / 2;                   float right2 = GO2->getPosition().x + CV2->width / 2;  
        float bottom1 = GO1->getPosition().y - CV1->height / 2;                 float bottom2 = GO2->getPosition().y - CV2->height / 2;
        float top1 = GO1->getPosition().y + CV1->height / 2;                    float top2 = GO2->getPosition().y + CV2->height / 2;    
        float back1 = GO1->getPosition().z - CV1->depth / 2;                    float back2 = GO2->getPosition().z - CV2->depth / 2;    
        float front1 = GO1->getPosition().z + CV1->depth / 2;                   float front2 = GO2->getPosition().z + CV2->depth / 2;

        //Check to see if they are not colliding
        bool m_collision = true;
       
        //Check to see if it's not colliding otherwise it must be
        if(bottom1 > top2) m_collision = false;
        if(top1 < bottom2) m_collision = false;
                                               
        if(right1 < left2) m_collision = false;
        if(left1 > right2) m_collision = false;
                                               
        if(front1 < back2) m_collision = false;
        if(back1 > front2) m_collision = false;
       
        int temp = 0;
               
        //If it is coliding check to see which side it hit
        if(m_collision)//COLLIDING!!!!!
        {
                //GO1->setVelocity(((GO1->getVelocity() * GO1->m_physics->m_mass) + (GO2->getVelocity() * GO2->m_physics->m_mass))
                        //                         / (GO1->m_physics->m_mass + GO2->m_physics->m_mass));
                GO1->setVelocity(Vector3(0.0f,0.0f,0.0f));

                Vector3 vdistance(GO2->getPosition() - GO1->getPosition());

        }
        */
}

bool RayToCube(D3DXVECTOR3 Start, float Length, Player* Player1)
{
        return false;
}
